import { isNullOrUndefined } from "util";

export const typeLists = [
    { name: '安装工程', id: 1 },
    { name: '地灾设计', id: 2 },
    { name: '地灾施工工程', id: 3 },
    { name: '房建工程', id: 4 },
    { name: '非煤矿山', id: 5 },
    { name: '钢结构工程', id: 6 },
    { name: '公路工程', id: 7 },
    { name: '矿建工程', id: 8 },
    { name: '桥梁工程', id: 9 },
    { name: '市政工程', id: 10 },
    { name: '水利水电工程', id: 11 },
    { name: '隧道工程', id: 12 },
    { name: '铁路工程', id: 13 },
    { name: '土地整治工程', id: 14 },
    { name: '土石方工程', id: 15 },
    { name: '消防工程', id: 16 },
    { name: '装饰工程', id: 17 },
    { name: '综合', id: 18 },
    { name: '其他', id: 19 }
]

export const statusLists = [
    { name: '勘探', id: 1 },
    { name: '可研', id: 2 },
    { name: '立项', id: 3 },
    { name: '投标', id: 4 },
]

export class findProjectModel {
    public type: number;
    public status: number;
    public filter: string;
    public sorting: string;
    public maxResultCount: number = 12;
    public skipCount: number = 0;
    public name: string;
    public address: string;
    public mark: number;
    public isImportant: any = '0';
    public isApprove: boolean;

    constructor(obj?) {
        const instance = this;
        if (!obj) return;
        (obj.type) && (instance.type = obj.type);
        (obj.status) && (instance.status = obj.status);
        (obj.filter) && (instance.filter = obj.filter);
        (obj.sorting) && (instance.sorting = obj.sorting);
        (obj.maxResultCount) && (instance.maxResultCount = obj.maxResultCount);
        (obj.skipCount) && (instance.skipCount = obj.skipCount);
        (obj.name) && (instance.name = obj.name);
        (obj.address) && (instance.address = obj.address);
        (obj.mark) && (instance.mark = obj.mark);
        (obj.isImportant) && (instance.isImportant = obj.isImportant);
        (obj.isApprove) && (instance.isApprove = obj.isApprove);
    }
}

export class addProjectModel {
    public name: string;
    public code: string;
    public address: string;
    public type: number = 1;
    public status: number = 1;
    public imageUrl: string;
    public description: string;
    public mark: any = '2';
    public location: string;
    public departName: string;
    public totalInCome: number = 0;
    public takeLimit: string;
    public isImportant: any = '2';
    public isApprove: any = '2';
    public companyName: string;
    public companyLinkman: string;
    public companyLinkphone: string;
    public companyAddress: string;
    public tenantId: number;
    public id: string;
    public permissionArray = [];

    constructor(obj?) {
        const instance = this;
        if (!obj) return;
        (obj.name) && (instance.name = obj.name);
        (obj.code) && (instance.code = obj.code);
        (obj.address) && (instance.address = obj.address);
        (obj.type) && (instance.type = obj.type);
        (obj.status) && (instance.status = obj.status);
        (obj.imageUrl) && (instance.imageUrl = obj.imageUrl);
        (obj.description) && (instance.description = obj.description);
        (obj.mark) && (instance.mark = obj.mark);
        (obj.location) && (instance.location = obj.location);
        (obj.departName) && (instance.departName = obj.departName);
        (obj.totalInCome) && (instance.totalInCome = obj.totalInCome);
        (obj.takeLimit) && (instance.takeLimit = obj.takeLimit);
        (obj.isImportant) && (instance.isImportant = obj.isImportant);
        (obj.isApprove) && (instance.isApprove = obj.isApprove);
        (obj.companyName) && (instance.companyName = obj.companyName);
        (obj.companyLinkman) && (instance.companyLinkman = obj.companyLinkman);
        (obj.companyLinkphone) && (instance.companyLinkphone = obj.companyLinkphone);
        (obj.companyAddress) && (instance.companyAddress = obj.companyAddress);
        (obj.tenantId) && (instance.tenantId = obj.tenantId);
        (obj.id) && (instance.id = obj.id);
        (obj.permissionArray) && (instance.permissionArray = obj.permissionArray);
     
    }
}